package com.xiaoyu.izf.exception;

import cn.hutool.core.util.StrUtil;
import com.xiaoyu.izf.enums.JsonReturnedEnum;

import java.io.Serializable;

public class JsonReturnedException extends RuntimeException implements Serializable {

    private String type;

    public JsonReturnedException(String type, String message) {
        super(message);
        this.type = type;
    }

    public JsonReturnedException(JsonReturnedEnum returnedEnum, String args) {
        super(StrUtil.format(returnedEnum.message(),args));
        this.type = returnedEnum.type();
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
}

